package xzy.com.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import xzy.com.dao.UserMapper;
import xzy.com.entity.domain.Users;
import xzy.com.service.LoginService;

@Service
public class LoginServiceImpl implements LoginService{

	@Resource
	private UserMapper userMapper;

	@Override
	public int add(Users obj) {
		int num=userMapper.insert(obj);
		return num;
	}

	@Override
	public int delete(Long id) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int edit(Users Object) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public Users getById(Long id) {
		Users user=userMapper.selectById(id);
		return user;
	}

	@Override
	public Users getByName(String name) {
		// TODO Auto-generated method stub
		return null;
	}
	

	@Override
	public Users get(Users obj) {
		QueryWrapper<Users> wrapper=new QueryWrapper<>();
		wrapper.eq("account",obj.getAccount());
		Users user=userMapper.selectOne(wrapper);
		return user;
	}

	@Override
	public List<Users> list() {
		// TODO Auto-generated method stub
		return null;
	}
	
}
